package com.insigma.business.common.utils;

import com.insigma.business.common.dto.CurrentUser;
import com.insigma.business.common.service.CurrentUserService;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
public class CurrentUserUtil {
    @Resource
    private CurrentUserService currentUserService;

    private static CurrentUserService currentUserServiceUtil;

    @PostConstruct
    public void init() {
        currentUserServiceUtil = currentUserService;
    }

    public static CurrentUser getCurrentUser() {
        return currentUserServiceUtil.getCurrentUser();
    }
}
